package com.tushare.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tushare.entity.Income;
import com.tushare.mapper.IncomeMapper;
import com.tushare.service.IIncomeService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author jobob
 * @since 2021-03-07
 */
@Service
public class IncomeServiceImpl extends ServiceImpl<IncomeMapper, Income> implements IIncomeService {

    @Override
    public boolean saveIncomes(List<Income> list) {
        if (list == null) {
            return false;
        }
        if (list.size() == 0) {
            return true;
        }
        return getBaseMapper().saveOrUpdateBatch(list);
    }

    @Override
    public boolean deleteAllIncome() {
        return getBaseMapper().deleteAllIncome();
    }
}
